Pseudo-code:
Global variables:
Constants using define declarations
o MAXN – the maximum number of characters in a band name
o MAXG – the maximum number of concerts/bands/groups
o MAXC – the maximum number of categories
Arrays:
o char group [MAXG][MAXN]– the name of each group
o int fans [MAXG][MAXC]– the number of fans at a concert by category
o float prices [MAXC]– the ticket price of each category
o float sales [MAXG]– the total value of the tickets for each concert
int count
o the actual number of active concerts/bands/groups
o this number is determined at run time in the getData function
o used throughout the rest of the program to only look at data in the
group, fans and salesarrays that is actually active.
Pseudo-Code:
1. main
a. getData – get ticket prices by category & get data for the concerts
b. computeSales – compute sales for each concert
c. printArray – print raw concert data
d. sortBySales – sort the concerts by value of sales, use selection sort
i. findMinSales – find min sales in unsorted rest of array
ii. switchRows – as needed
e. printArray – print sorted concert data
2. getData
a. prompt for ticket prices
b. get ticket prices into prices array
c. prompt for band name and fans in each category at each concert
d. insert data into appropriate arrays, ending with a period
i. loop on concert
1. get group name
2. loop inside on number of categories
3. computeSales
a. for each group
i. sales for that group = 0
Pseudo-code:
Global variables:
Constants using define declarations
o MAXN – the maximum number of characters in a band name
o MAXG – the maximum number of concerts/bands/groups
o MAXC – the maximum number of categories
Arrays:
o char group [MAXG][MAXN]– the name of each group
o int fans [MAXG][MAXC]– the number of fans at a concert by category
o float prices [MAXC]– the ticket price of each category
o float sales [MAXG]– the total value of the tickets for each concert
int count
o the actual number of active concerts/bands/groups
o this number is determined at run time in the getData function
o used throughout the rest of the program to only look at data in the
group, fans and salesarrays that is actually active.
Pseudo-Code:
1. main
a. getData – get ticket prices by category & get data for the concerts
b. computeSales – compute sales for each concert
c. printArray – print raw concert data
d. sortBySales – sort the concerts by value of sales, use selection sort
i. findMinSales – find min sales in unsorted rest of array
ii. switchRows – as needed
e. printArray – print sorted concert data
2. getData
a. prompt for ticket prices
b. get ticket prices into prices array
c. prompt for band name and fans in each category at each concert
d. insert data into appropriate arrays, ending with a period
i. loop on concert
1. get group name
2. loop inside on number of categories
3. computeSales
a. for each group
i. sales for that group = 0
Download all 19 pages for $ 7.07
Add document to cartALL DOCUMENTS ON THIS PAGE ARE ON OFFER FROM 05/08/2024-07/011/2024
NURSING EXAMS AND TEST BANKS. Contact us, https://www.docsity.com/en/users/profile/HESISOLUTIONS/
to fetch it for you in minutes if we do not have it in this shop .BUY WITHOUT DOUBT!!!!Always leave a review after purchasing any document so as to make sure our customers are 100% satisfied.
ati ati comprehensive predictor ati fundamentals proctored ati pharmacology ati pharmacology proctored community health comprehensive health care health care / nursing health care/ nursing healthcare hesi hesi rn exit leadership maternal newborn med surg medical surgical mental health nurs nursing nursing & health pediatrics pharmacology test bank tncc